using System;
using System.Collections.Generic;

using TnPlus.Entities.Utils;
using TnPlus.Entities.Models;
using TnPlus.DAL;
using TnPlus.Common;

namespace TnPlus.Biz
{
	public class PortfolioHistoryService
	{
		/// <summary>
		/// Saves a record to the PortfolioHistory table.
		/// </summary>
		public virtual void Insert(PortfolioHistoryInfo portfolioHistoryInfo)
		{
			try
			{
				new PortfolioHistoryDAO().Insert(portfolioHistoryInfo);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.PortfolioHistory - Insert", ex);
				throw;
			}

		}

		/// <summary>
		/// Saves a record to the PortfolioHistory table.
		/// </summary>
		public virtual void Update(PortfolioHistoryInfo portfolioHistoryInfo)
		{
			try
			{
				new PortfolioHistoryDAO().Update(portfolioHistoryInfo);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.PortfolioHistory - Update", ex);
				throw;
			}

		}

		/// <summary>
		/// Delete a record from the PortfolioHistory table.
		/// </summary>
		public virtual void Delete(Guid? idPortfolio)
		{
			try
			{
				new PortfolioHistoryDAO().Delete(idPortfolio);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.PortfolioHistory - Delete", ex);
				throw;
			}

		}

		/// <summary>
		/// Selects a single record from the PortfolioHistory table.
		/// </summary>
		public virtual PortfolioHistoryInfo Select(Guid? idPortfolio)
		{
			try
			{
				return new PortfolioHistoryDAO().Select(idPortfolio);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.PortfolioHistory - Select", ex);
				throw;
			}

		}

		/// <summary>
		/// Selects all records from the PortfolioHistory table.
		/// </summary>
		public List<PortfolioHistoryInfo> SelectAll()
		{
			try
			{
				return new PortfolioHistoryDAO().SelectAll();
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.PortfolioHistory - SelectAll", ex);
				throw;
			}

		}

	}
}
